const express=require('express')
const router=express.Router()
const pool=require('../pool')
const query=require('./utils')
const {host} = require('./host')
const multer=require('multer')
const bodyparser=require('body-parser')
router.get('/',async (req,res)=>{
    let value=req.query.value
    let page=req.query.page
    let count=8
    let start=(parseInt(page)-1)*count
    let sql=` select * from zhuanji WHERE song LIKE '%${value}%' limit ${start},${count}`
    let ret=await query(sql)
    let sql2=`SELECT * FROM detail WHERE song LIKE '%${value}%' limit ${start},${count}`
    let ret2=await query(sql2)
    let result=[...ret,...ret2]
    res.send(result)

})
module.exports=router